package com.wz.app.adapter;

import java.util.ArrayList;
import java.util.List;

import com.wz.app.frgment.NewsFragment;
import com.wz.app.frgment.OtherFragment;
import com.wz.app.frgment.WeatherFragment;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

public class FragmentAdapter extends FragmentPagerAdapter {

	private List<Fragment> list;
	
	public FragmentAdapter(FragmentManager fm ) {
		super(fm);
		list = new ArrayList<Fragment>();

		Fragment newsFragment = new NewsFragment();
		Fragment weatherFragment = new WeatherFragment();
		Fragment otherFragment = new OtherFragment();
		
		list.add(newsFragment);
		list.add(weatherFragment);
		list.add(otherFragment);
	}
	

	@Override
	public Fragment getItem(int arg0) {
		// TODO Auto-generated method stub
		return list.get(arg0);
	}

	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return list.size();
	}

 
}
